3.206 \(\int \frac{\cot (x)}{\cot (x)+\csc (x)} \, dx\)

Optimal. Leaf size=12 \[ x-\frac{\sin (x)}{\cos (x)+1} \]

[Out]

x - Sin[x]/(1 + Cos[x])

________________________________________________________________________________________

Rubi [A]  time = 0.0535888, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.3, Rules used = {4392, 2735, 2648} \[ x-\frac{\sin (x)}{\cos (x)+1} \]

Antiderivative was successfully verified.

[In]

Int[Cot[x]/(Cot[x] + Csc[x]),x]

[Out]

x - Sin[x]/(1 + Cos[x])

Rule 4392

Int[(cot[(c_.) + (d_.)*(x_)]^(n_.)*(a_.) + csc[(c_.) + (d_.)*(x_)]^(n_.)*(b_.))^(p_)*(u_.), x_Symbol] :> Int[A
ctivateTrig[u]*Csc[c + d*x]^(n*p)*(b + a*Cos[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2648

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> -Simp[Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rubi steps

\begin{align*} \int \frac{\cot (x)}{\cot (x)+\csc (x)} \, dx &=\int \frac{\cos (x)}{1+\cos (x)} \, dx\\ &=x-\int \frac{1}{1+\cos (x)} \, dx\\ &=x-\frac{\sin (x)}{1+\cos (x)}\\ \end{align*}

Mathematica [A]  time = 0.017545, size = 10, normalized size = 0.83 \[ x-\tan \left (\frac{x}{2}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[x]/(Cot[x] + Csc[x]),x]

[Out]

x - Tan[x/2]

________________________________________________________________________________________

Maple [A]  time = 0.057, size = 9, normalized size = 0.8 \begin{align*} -\tan \left ({\frac{x}{2}} \right ) +x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)/(cot(x)+csc(x)),x)

[Out]

-tan(1/2*x)+x

________________________________________________________________________________________

Maxima [A]  time = 1.66572, size = 31, normalized size = 2.58 \begin{align*} -\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 2 \, \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(cot(x)+csc(x)),x, algorithm="maxima")

[Out]

-sin(x)/(cos(x) + 1) + 2*arctan(sin(x)/(cos(x) + 1))

________________________________________________________________________________________

Fricas [A]  time = 0.48709, size = 51, normalized size = 4.25 \begin{align*} \frac{x \cos \left (x\right ) + x - \sin \left (x\right )}{\cos \left (x\right ) + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(cot(x)+csc(x)),x, algorithm="fricas")

[Out]

(x*cos(x) + x - sin(x))/(cos(x) + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cot{\left (x \right )}}{\cot{\left (x \right )} + \csc{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(cot(x)+csc(x)),x)

[Out]

Integral(cot(x)/(cot(x) + csc(x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.13233, size = 11, normalized size = 0.92 \begin{align*} x - \tan \left (\frac{1}{2} \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(cot(x)+csc(x)),x, algorithm="giac")

[Out]

x - tan(1/2*x)